package com.zmn.mcc.persistence.interfaces.role;

import com.zmn.mcc.model.entity.role.McRolePermit;
import com.zmn.mcc.model.entity.role.McRoleStaff;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author heguanghua
 * @since 2020/04/14 12:13
 */
public interface RoleStaffDao {

    McRoleStaff findByKey(McRoleStaff roleStaff);

    List<Integer> listStaffIdByRoleId(Integer roleId);

    List<Integer> listStaffIdBySysId(Integer sysId);

    List<Integer> listRoleIdByStaffId(Integer staffId);

    List<Integer> listPermitBySatffIdAndUrl(@Param("staffId") Integer staffId, @Param("url") String url);

    /**
     * 描述: 根据角色id列表，查询员工id
     *
     * @param roleIdList 角色id集合
     * @return List<Integer>
     * @author xujie
     * @since 2021/04/28
     **/
    List<Integer> listStaffIdByRoleIdList(@Param("roleIdList") List<Integer> roleIdList);

    List<McRoleStaff> listPage(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);

    /**
     * 描述: 根据员工id列表，查询角色-授权人员关系
     *
     * @param staffIdList 角色-授权人员关系
     * @return List<McRoleStaff>
     * @author xujie
     * @since 2021/05/28
     **/
    List<McRoleStaff> listRoleStaffByStaffIdList(@Param("staffIdList") List<Integer> staffIdList);

    Integer countByQuery(McRoleStaff roleStaff);


    Integer insert(McRoleStaff roleStaff);

    Integer insertByBatch(List<McRoleStaff> roleStaffs);


    Integer deleteByKey(McRoleStaff roleStaff);

    Integer deleteByQuery(McRoleStaff roleStaff);

}
